function ch = mutation(chroms,total_op_num,Pm)
global  operation_time operation_machine  num_job ;
ch=[];
for p=1:size(chroms,1) 
    if Pm>rand  
        chrom=chroms(p,:);
        job=randperm(num_job,2); 
        job_ind=zeros(1,2);
        for j=1:2
        temp=find(chrom(1:total_op_num)==job(j));
        jj=randperm(length(temp),1);
        job_ind(j)=temp(jj);
        end
        chrom1=chrom;
        chrom1(job_ind)=fliplr(job);
        tempss=chrom(1:total_op_num);
        tempdd=zeros(total_op_num,1);    
        for k=1:total_op_num
            tempind=find(tempss==chrom1(k));
            tempdd(k)=tempind(1);
            tempss(tempind(1))=0;
        end
        tempind=chrom(total_op_num+1:total_op_num*2);
        chrom1(total_op_num+1:total_op_num*2)=tempind(tempdd);
        tempind=chrom(total_op_num*2+1:end);
        chrom1(total_op_num*2+1:end)=tempind(tempdd);
        if p==1
            ch=chrom1;
        else
            ch=[ch;chrom1];
        end
    end
end
for i=1:size(chroms,1)
    if Pm>rand
        chrom=chroms(i,:);
        ind=randperm(total_op_num,1);  
        job=chrom(ind);  
        job_ind=find(chrom(1:total_op_num)==job);
        op=find(job_ind==ind); 
        machines=operation_machine{job}{op};  
        times=operation_time{job}{op};
        ind1=find(machines==chrom(total_op_num+ind));    
        machines(ind1)=[];
        times(ind1)=[];
        flag=0;
        if ~isempty(machines)
            ii=randperm(length(machines),1);
            chrom(total_op_num+ind)=machines(ii);
            chrom(total_op_num*2+ind)=times(ii);
            flag=1;
        end
        if flag==1
              ch=[ch;chrom];
        end
    end
end
ch=[ch;chroms];
end